package net.towee.client.widgets.upload.impl;

import net.towee.client.widgets.upload.UploadItem;
import net.towee.client.widgets.upload.UploadProgressHandler;

public abstract class AbstractUploadItem implements UploadItem {
	protected UploadProgressHandler handler;
	protected UploadState state;
	
	protected String response;
	protected String fileName;
	protected long fileSize = -1;
	
	@Override
	public void setProgressHandler(final UploadProgressHandler handler) {
		this.handler = handler;
	}

	@Override
	public String getFileName() {
		return fileName;
	}

	@Override
	public long getFileSize() {
		return fileSize;
	}

	@Override
	public String getResponse() {
		return response;
	}

	@Override
	public boolean isComplited() {
		return state == UploadState.COMPLITED;
	}

	@Override
	public boolean isQueued() {
		return state == UploadState.QUEUED;
	}

	@Override
	public boolean isError() {
		return state == UploadState.ERROR;
	}

	@Override
	public boolean isCanceled() {
		return state == UploadState.CANCELED;
	}
}
